$OpenBSD: patch-Makefile,v 1.4 2014/02/03 13:30:52 dcoppa Exp $
--- Makefile.orig	Fri Jan 31 14:57:23 2014
+++ Makefile	Mon Feb  3 12:26:26 2014
@@ -55,7 +55,7 @@ ifeq (SunOS, $(OS))
 endif
 
 # APIVERSION is used to build SONAME
-APIVERSION = 10
+APIVERSION ?= 10
 
 SRCS = igd_desc_parse.c miniupnpc.c minixml.c minisoap.c miniwget.c \
        upnpc.c upnpcommands.c upnpreplyparse.c testminixml.c \
@@ -123,7 +123,7 @@ INSTALLPREFIX ?= $(PREFIX)/usr
 INSTALLDIRINC = $(INSTALLPREFIX)/include/miniupnpc
 INSTALLDIRLIB = $(INSTALLPREFIX)/$(LIBDIR)
 INSTALLDIRBIN = $(INSTALLPREFIX)/bin
-INSTALLDIRMAN = $(INSTALLPREFIX)/share/man
+INSTALLDIRMAN = $(INSTALLPREFIX)/man
 
 FILESTOINSTALL = $(LIBRARY) $(EXECUTABLES)
 ifneq ($(OS), AmigaOS)
@@ -144,11 +144,11 @@ check:	validateminixml validateminiwget validateupnpre
 everything:	all $(EXECUTABLES_ADDTESTS)
 
 pythonmodule:	$(LIBRARY) miniupnpcmodule.c setup.py
-	python setup.py build
+	${MODPY_BIN} setup.py build
 	touch $@
 
 installpythonmodule:	pythonmodule
-	python setup.py install
+	${MODPY_BIN} setup.py install --prefix=$(PREFIX)
 
 pythonmodule3:	$(LIBRARY) miniupnpcmodule.c setup.py
 	python3 setup.py build
@@ -195,7 +195,6 @@ install:	updateversion $(FILESTOINSTALL)
 	$(INSTALL) -m 644 $(LIBRARY) $(DESTDIR)$(INSTALLDIRLIB)
 ifneq ($(OS), AmigaOS)
 	$(INSTALL) -m 644 $(SHAREDLIBRARY) $(DESTDIR)$(INSTALLDIRLIB)/$(SONAME)
-	ln -fs $(SONAME) $(DESTDIR)$(INSTALLDIRLIB)/$(SHAREDLIBRARY)
 endif
 	$(INSTALL) -d $(DESTDIR)$(INSTALLDIRBIN)
 ifeq ($(OS), AmigaOS)
@@ -229,7 +228,7 @@ ifeq ($(OS), Darwin)
 #	$(CC) -dynamiclib $(LDFLAGS) -Wl,-install_name,$(SONAME) -o $@ $^
 	$(CC) -dynamiclib $(LDFLAGS) -Wl,-install_name,$(INSTALLDIRLIB)/$(SONAME) -o $@ $^
 else
-	$(CC) -shared $(LDFLAGS) -Wl,-soname,$(SONAME) -o $@ $^
+	$(CC) -shared $(LDFLAGS) -o $@ $^
 endif
 
 upnpc-static:	upnpc.o $(LIBRARY)
